Skip to content

Add optional ;user=phone on outbound SIP URIs (#615) - #769

Open
lixuanqun wants to merge 1 commit into
livekit:mainfrom
lixuanqun:cursor/fix-uri-user-phone-33f3
Open

Add optional ;user=phone on outbound SIP URIs (#615)#769
lixuanqun wants to merge 1 commit into
livekit:mainfrom
lixuanqun:cursor/fix-uri-user-phone-33f3

Conversation

@lixuanqun

Copy link
Copy Markdown

Summary

Fixes #615.

Some PSTN carriers (notably Airtel and similar Indian trunks) require the RFC 3261 / RFC 3966 ;user=phone URI parameter on outbound Request-URI, From, and To. LiveKit previously had no way to add URI parameters there (custom headers / trunk address cannot do this).

This change adds an opt-in:

  1. Config (self-hosted): uri_user_phone: true in SIP service YAML
  2. Feature flag (Cloud / per-project): sip.uri_user_phone=true on the create-participant request feature flags

When enabled, ;user=phone is appended to Request-URI, From, and To (idempotent if already present). Contact is unchanged. Default remains off.

Longer term, a trunk-level uri_params field in protocol would be nicer; this unblocks carriers without a protocol bump.

Test plan

  • TestBuildOutboundHeaders covers config, feature flag, transport combo, and raw-URI idempotency
  • Self-tested 3×
go test ./pkg/sip/ -run 'TestBuildOutboundHeaders' -count=1

Usage

# config.yaml
uri_user_phone: true

or project feature flag sip.uri_user_phone=true.

Open in Web Open in Cursor 

Some PSTN carriers (e.g. Airtel) require the RFC 3261/3966 user=phone
URI parameter on Request-URI, From, and To. Enable via config
uri_user_phone or feature flag sip.uri_user_phone=true.

Co-authored-by: li xuanqun <793005378@qq.com>
@lixuanqun
lixuanqun requested a review from a team as a code owner August 3, 2026 09:46

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.06%. Comparing base (0460b40) to head (167a816).
⚠️ Report is 340 commits behind head on main.

Files with missing lines Patch % Lines
pkg/sip/client.go 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #769      +/-   ##
==========================================
+ Coverage   65.25%   66.06%   +0.81%     
==========================================
  Files          51       41      -10     
  Lines        6588     7960    +1372     
==========================================
+ Hits         4299     5259     +960     
- Misses       1915     2216     +301     
- Partials      374      485     +111     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIP<>Airtel Outbound Calling

2 participants